package client.chat;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

public class PanelTop extends JPanel {

	private JTextArea history;
	private JScrollPane scrollPane;
	
	private FrameChat frame;

	public PanelTop(FrameChat frame) {
		
		this.frame = frame;

		setBackground(Color.BLACK);
		setLayout(new BorderLayout());

		
		history = new JTextArea();
		
		history.setEditable(false);
		history.setLineWrap(true);

		scrollPane = new JScrollPane(history);
		scrollPane
				.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
		scrollPane
				.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
		scrollPane.setPreferredSize(new Dimension(280, 290));

		add(scrollPane, BorderLayout.CENTER);
		setVisible(true);

	}

	
	public JTextArea getTextAreaHistory() {
		return history;
	}
}
